#include"ros/ros.h"
#include"std_msgs/String.h"
#include"std_msgs/MultiArrayLayout.h"
#include"std_msgs/MultiArrayDimension.h"
#include<sstream>
#include"word_draw_processing/WordDrawLayout.h"
#include"word_draw_processing/WordDrawDimension.h"

class TestWordTalker
{
  ros::NodeHandle n;
  ros::Publisher chatter_pub;

public:
  TestWordTalker()
  {
    chatter_pub = n.advertise<word_draw_processing::WordDrawLayout>("chatter", 100);
  }

  ~TestWordTalker()
  {


  }

  void TestWordTalkerPR()
  {
    word_draw_processing::WordDrawLayout wdl_;
    word_draw_processing::WordDrawDimension tmp_wdd_;

    tmp_wdd_.word = "ホンダの";
    tmp_wdd_.id = 1;
    tmp_wdd_.link = 5;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "二";
    tmp_wdd_.id = 2;
    tmp_wdd_.link = 3;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "足";
    tmp_wdd_.id = 3;
    tmp_wdd_.link = 4;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "歩行";
    tmp_wdd_.id = 4;
    tmp_wdd_.link = 5;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "ロボット";
    tmp_wdd_.id = 5;
    tmp_wdd_.link = 6;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "「アシモ」が";
    tmp_wdd_.id = 6;
    tmp_wdd_.link = 13;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "東京電力";
    tmp_wdd_.id = 7;
    tmp_wdd_.link = 8;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "福島";
    tmp_wdd_.id = 8;
    tmp_wdd_.link = 10;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "第一";
    tmp_wdd_.id = 9;
    tmp_wdd_.link = 10;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "原発の";
    tmp_wdd_.id = 10;
    tmp_wdd_.link = 12;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "事故";
    tmp_wdd_.id = 11;
    tmp_wdd_.link = 12;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "現場に";
    tmp_wdd_.id = 12;
    tmp_wdd_.link = 13;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "投入される";
    tmp_wdd_.id = 13;
    tmp_wdd_.link = 14;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "可能性が";
    tmp_wdd_.id = 14;
    tmp_wdd_.link = 15;
    wdl_.wdd.push_back(tmp_wdd_);

    tmp_wdd_.word = "出てきた";
    tmp_wdd_.id = 15;
    tmp_wdd_.link = -1;
    wdl_.wdd.push_back(tmp_wdd_);

    chatter_pub.publish(wdl_);

  }
};


int main(int argc, char **argv)
{
  ros::init(argc, argv, "TestWordTalker");
  TestWordTalker t_TestWordTalker;
  ros::Rate loop_rate(10);

  while(ros::ok())
  {
    t_TestWordTalker.TestWordTalkerPR();
    ros::spinOnce();
    loop_rate.sleep();
  }

  return 0;
}
